﻿@page "{id:int?}"
@model SchemeViewModel
@inject PluginContext pluginContext 
@{
    Layout = "_BasicLayout";
    dynamic dict = Locale.GetDictionary("Scada.Web.Plugins.PlgScheme.Areas.Scheme.Pages.SchemeView");
    const string PluginRoot = "~/plugins/";
}

@section Styles {
    <link href="~/plugins/Scheme/css/scheme-view.min.css" rel="stylesheet" asp-append-version="true" />

    @foreach (var url in pluginContext.CompManager.GetAllStyles(PluginRoot))
    {
        <link href="@url" rel="stylesheet" asp-append-version="true" />
    }
}

@section Scripts {
    <script src="~/js/view-hub.js" asp-append-version="true"></script>
    <script src="~/js/components/modal.js" asp-append-version="true"></script>
    <script src="~/plugins/Main/js/main-api.js" asp-append-version="true"></script>
    <script src="~/plugins/Scheme/js/scheme-common.js" asp-append-version="true"></script>
    <script src="~/plugins/Scheme/js/scheme-model.js" asp-append-version="true"></script>
    <script src="~/plugins/Scheme/js/scheme-render.js" asp-append-version="true"></script>
    <script src="~/plugins/Scheme/js/scheme-view.js" asp-append-version="true"></script>
    <script>
        viewID = @Model.ViewID;
        controlRight = @Model.ControlRight.ToLowerString();
        schemeOptions = @pluginContext.Options.ToJs();
    </script>

    @foreach (var url in pluginContext.CompManager.GetAllScripts(PluginRoot))
    {
        <script src="@url" asp-append-version="true"></script>
    }
}

<div id="divNotif" class="hidden"></div>
<div id="divSchWrapper" class="scheme-wrapper"></div>
<div id="divToolbar"><span 
    id="spanFitScreenBtn" class="tool-btn" title="@dict.spanFitScreenBtn_ToolTip"><i class="fa-solid fa-up-down-left-right"></i></span><span
    id="spanFitWidthBtn" class="tool-btn" title="@dict.spanFitWidthBtn_ToolTip"><i class="fa-solid fa-solid fa-left-right"></i></span><span
    id="spanZoomOutBtn" class="tool-btn" title="@dict.spanZoomOutBtn_ToolTip"><i class="fa-solid fa-search-minus"></i></span><span
    id="spanZoomInBtn" class="tool-btn" title="@dict.spanZoomInBtn_ToolTip"><i class="fa-solid fa-search-plus"></i></span><span 
    id="spanCurScale">100%</span><span 
    id="spanErrorBadge" class="badge bg-danger hidden">@dict.spanErrorBadge</span><div 
    id="divDebugTools"><span 
        id="spanLoadSchemeBtn" class="tool-btn">Load Scheme</span><span 
        id="spanCreateDomBtn" class="tool-btn">Create DOM</span><span 
        id="spanStartUpdBtn" class="tool-btn">Start Updating</span><span 
        id="spanAddNotifBtn" class="tool-btn">Add Notification</span>
    </div>
</div>
